using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.MediaPlayer.Interop;

using System.Diagnostics;



namespace VTour2
{
    public partial class FormVideo : Form
    {
        AxWMPLib.AxWindowsMediaPlayer movie2 = new AxWMPLib.AxWindowsMediaPlayer();

        public FormVideo()
        {
            InitializeComponent();
        }

        public void play()
        {
            /*
            Process process = new Process();
            process.StartInfo.FileName = "/My Documents/Vtour2/glass.wmv";
            process.StartInfo.Verb = "Open";
            process.StartInfo.UseShellExecute = true;
            process.Start();
             */
            Screen2.currentMedia = movie2.newMedia("/My Documents/Vtour2/GasTown.WMV");

            Screen2.Ctlcontrols.play();
            timer1.Enabled = true;
            

            //movie.fullScreen = true;
            //movie.settings.autoStart = this.Screen();
            //movie.currentMedia = 
            //movie.openPlayer("hi");


            
            //movie.stretchToFit = true;
            //movie.fullScreen = true;
            //movie.controls.play();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            if (Screen2.playerApplication.hasDisplay)
            {
                Screen2.fullScreen = true;
                timer1.Enabled = false;
            }
        }

        private void Screen2_EndOfStream(object sender, AxWMPLib._WMPOCXEvents_EndOfStreamEvent e)
        {
            this.Visible = false;
        }

        private void menuItem1_Click(object sender, EventArgs e)
        {
            Screen2.fullScreen = true;
        }

        private void menuItem2_Click(object sender, EventArgs e)
        {
            Screen2.Ctlcontrols.stop();
            this.Visible = false;        
        }
    }
}